From 6ac9d5dbfded9610d8208378a3be49b1ccd8fe9a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 16 Jul 2012 19:56:00 -0700 Subject: [PATCH] Don't use IN_FLOAT() when calling fabs() since it may clobber errno. The emacs build shouldn't fail sometimes with an "Arithmetic error:". Previously Emacs assumed that fabs() would not modify errno unless there was an error, but that isn't guaranteed since fabs() has no error conditions. Origin: upstream, commit: 8e0e7a92f5ae99ce2461fc0f0b606d4cec3efb81 Added-by: Rob Browning Provided-By: Paul Eggert Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11913 --- src/ChangeLog | 6 ++++++ src/floatfns.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 98c4124679b..32631e77ce9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-07-17 Paul Eggert + + * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913). + Unlike the other wrapped functions, fabs has an unspecified + effect on errno. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/src/floatfns.c b/src/floatfns.c index 305c78cae63..fa672c76431 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -676,7 +676,7 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0, CHECK_NUMBER_OR_FLOAT (arg); if (FLOATP (arg)) - IN_FLOAT (arg = make_float (fabs (XFLOAT_DATA (arg))), "abs", arg); + arg = make_float (fabs (XFLOAT_DATA (arg))); else if (XINT (arg) < 0) XSETINT (arg, - XINT (arg)); -- 2.30.2